import request from '@/config/axios'

// 公积金贷款 VO
export interface HouseFundVO {
  id: number // 编号
  name: string // 姓名
  phone: string // 手机号
  city: string // 城市
  loanAmount: number // 所需额度
}

// 公积金贷款 API
export const HouseFundApi = {
  // 查询公积金贷款分页
  getHouseFundPage: async (params: any) => {
    return await request.get({ url: `/weiyi/house-fund/page`, params })
  },

  // 查询公积金贷款详情
  getHouseFund: async (id: number) => {
    return await request.get({ url: `/weiyi/house-fund/get?id=` + id })
  },

  // 新增公积金贷款
  createHouseFund: async (data: HouseFundVO) => {
    return await request.post({ url: `/weiyi/house-fund/create`, data })
  },

  // 修改公积金贷款
  updateHouseFund: async (data: HouseFundVO) => {
    return await request.put({ url: `/weiyi/house-fund/update`, data })
  },

  // 删除公积金贷款
  deleteHouseFund: async (id: number) => {
    return await request.delete({ url: `/weiyi/house-fund/delete?id=` + id })
  },

  // 导出公积金贷款 Excel
  exportHouseFund: async (params) => {
    return await request.download({ url: `/weiyi/house-fund/export-excel`, params })
  }
}